package edu.zut.cs.software.example.teach.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.cs.software.example.base.domain.BaseTreeEntity;


@Entity
@Table(name = "T_CLASE")
@NamedQueries({ @NamedQuery(name = "Clase.getRoot", query = "select m from Clase m where m.parent is null") })
public class Clase extends BaseTreeEntity<Clase, Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * name for clase
	 */
	@Column
	String name;

	/**
	 * code for clase
	 */
	@Column
	String code;
	
	@OneToMany(mappedBy = "clase", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<Student> students;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	
	

}
